

import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpFilter;


@SuppressWarnings("serial")
@WebFilter("/ABCFilter")
public class ABCFilter extends HttpFilter implements Filter {
       
   
    public ABCFilter() {
        super();
        System.out.println("ABC Filter 的构造方法被执行");
    }

	
	public void destroy() {
		System.out.println("ABC Filter 的销毁方法被执行");
	}

	
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
		
		System.out.println("ABCFilter 进入 chain.doFilter 前执行的代码");
	    
	    chain.doFilter(request, response);
	    
	    System.out.println("ABCFilter 退出 chain.doFilter 后执行的代码");
	}

	
	public void init(FilterConfig fConfig) throws ServletException {
		
		System.out.println("ABC Filter 的初始化方法被执行");
		
	}

}
